//
//  AliPayManager.h
//  SonDelivery
//
//  Created by 巩少鹏 on 2020/4/3.
//  Copyright © 2020 巩少鹏. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <AlipaySDK/AlipaySDK.h>
#import "GSOrderInfo.h"
#import "GSAuthInfo.h"

NS_ASSUME_NONNULL_BEGIN

@interface AliPayManager : NSObject

+ (AliPayManager *)defaultManager;

#pragma mark - 配置
-(void)AlipayConfig;

#pragma mark   ==============点击订单支付行为==============

-(void)payOrder:(GSBizContent *)model complete:(void (^)(NSDictionary *resultDic))complete;

#pragma mark - 唤起支付
/*
 * 如果后台把OrderInfo所有的数据参数进行加密和拼接处理过后,可直接调用此方法
 * 例：(将商品信息拼接成字符串)&sign=(RSA签名) = orderString
*/
-(void)payOrderWithOrderString:(NSString *)orderString complete:(void (^)(NSDictionary *resultDic))complete;


#pragma mark   ==============点击授权行为==============
/*
 * 调用支付宝授权
 * codeback 返回 authCode
*/
-(void)new_doAPAuth:(void (^)(NSString *authCode))codeback;

-(void)new_doAPAuthComplete:(void (^)(NSDictionary *resultDic))complete codeback:(void (^)(NSString *authCode))codeback;



#pragma mark - 支付跳转支付宝钱包进行支付，处理支付结果
-(void)new_processOrderWithPaymentResult:(NSURL *)url;
-(void)new_processOrderWithPaymentResult:(NSURL *)url standbyCallback:(void (^)(NSDictionary *resultDic))standbyCallback;

#pragma mark - 授权跳转支付宝钱包进行支付，处理支付结果
-(void)new_processAuth_V2Result:(NSURL *)url;
-(void)new_processAuth_V2Result:(NSURL *)url standbyCallback:(void (^)(NSDictionary *resultDic))standbyCallback;

@end

NS_ASSUME_NONNULL_END
